<div class="row">
	<div class="col-md-12">
		<h1>Gian hàng <small>Danh sách gian hàng</small></h1>
		<ol class="breadcrumb">
            <li><a href="<?php echo admin_page_url(); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li class="active"><i class="fa fa-table"></i> Các gian hàng hiện có</li>
        </ol>
    </div>
</div>

<div class="row">
    <div class="col-md-6 col-xs-12">
        <form method="get" action="<?php echo admin_page_url(SHOP_SLUG.'/tim-kiem'); ?>" enctype="multipart/form-data">
            <div class="input-group">
                <input type="text" class="form-control" name="s" value="<?php echo isset($searchkey)?$searchkey:''; ?>" placeholder="Tìm kiếm" />
                <span class="input-group-btn">
                    <button class="btn btn-success" type="submit"><i class="fa fa-search"></i> Tìm kiếm!</button>
                </span>
            </div><!-- /input-group -->
        </form>
    </div>
    <div class="clearfix"></div>

    <div class="col-md-12 col-xs-12 mgt10">
        <?php echo $pagingBar; ?>
    </div>

    <div class="col-md-12 mgt5">
        <form method="post" action="<?php echo admin_page_url(SHOP_SLUG.'/cap-nhat-trang-thai'); ?>" action-setting='<?php echo admin_page_url(SHOP_SLUG.'/cap-nhat-so-san-pham'); ?>'>
            <div class="table-responsive">
                <table class="table table-bordered table-hover tablesorter item-list">
                    <thead>
                        <tr>
                            <th class="header"># <i class="fa fa-sort"></i></th>
                            <th class="header">Banner</th>
                            <th class="header">Gian hàng <i class="fa fa-sort"></i></th>
                            <th class="header">Người dùng <i class="fa fa-sort"></i></th>
                            <th class="header">Số sản phẩm được hiển thị</th>
                            <th class="header"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($aShop as $index=>$tShop) { ?>
                        <tr class="can-edit" data-id="<?php echo $this->encrypt->encode($tShop->getId()); ?>">
                            <th class="header bg-info"><?php echo $index+1; ?></th>
                            <td class="col-md-1 col-xs-12">
                                <div class="media">
                                    <?php if($tShop->banner!='') { ?>
                                    <a href="<?php echo banner_upload($tShop->banner, $tShop->image_folder, false); ?>" class="thumbnail fancybox">
                                        <img class="media-object" src="<?php echo banner_upload($tShop->banner, $tShop->image_folder); ?>" />
                                    </a>
                                    <?php } else { ?>
                                    <a href="#" class="thumbnail">
                                        <img data-src='holder.js/150x100%' class="media-object" src="" />
                                    </a>
                                    <?php } ?>
                                </div>
                                <a class="btn btn-success input-raovat-slug mgt5" target="_blank" data-slug="<?php echo $tShop->getSlug(); ?>" href="<?php echo shop_url($tShop->getSlug()); ?>">
                                    <i class='glyphicon glyphicon-share-alt'></i> Xem
                                </a>
                            </td>
                            <td>
                                <h4><a class="strong big-title" href="<?php echo shop_url($tShop->getSlug()); ?>"><?php echo $tShop->getTitle(); ?></a></h4>
                                <p><i class="fa fa-anchor"></i> Homepage : <a href="<?php echo $tShop->home_page; ?>"><?php echo $tShop->home_page; ?></a></p>
                                <p><i class="fa fa-calendar"></i> Ngày tham gia : <?php echo fdate_format($tShop->shop_created_at); ?></p>
                                <p><i class="fa fa-mobile"></i> Phone : <?php echo $tShop->phone; ?> / <?php echo $tShop->home_phone; ?></p>
                                <div>
                                    <p><i class="fa fa-home"></i> Address :</p>
                                    <textarea readonly="readonly" class="form-control"><?php echo $tShop->address; ?></textarea>
                                </div>
                            </td>
                            <td class="input-shop-title">
                                <?php
                                    $edit_link = admin_page_url(USER_SLUG.'/cap-nhat', array('u'=>$this->encrypt->encode($tShop->user_id)));
                                ?>
                                <p>
                                    <i class="fa fa-user"></i> Họ và tên:
                                    <a href="<?php echo $edit_link; ?>"><?php echo $tShop->fullName ?></a>
                                </p>
                                <p><i class="fa fa-envelope"></i> Email : <a href="mailto:<?php echo $tShop->email; ?>"><?php echo $tShop->email; ?></a></p>
                                <p><i class="fa fa-skype"></i> Skype : <a href="skype:<?php echo $tShop->skype; ?>?call"><?php echo $tShop->skype; ?></a></p>
                            </td>
                            <td>
                                <div class="input-group w90">
                                    <input type="text" class="form-control input-shop-block-product-count" value="<?php echo $tShop->block_product_num; ?>"/>
                                    <span class="input-group-btn">
                                        <button class="btn btn-success btn-shop-block-product-count" type="button"><i class='glyphicon glyphicon-ok-sign'></i></button>
                                    </span>
                                </div><!-- /input-group -->
                            </td>
                            <td class="input-shop-flg">
                                <p class="inline-table clearMgr">
                                    Nổi bật
                                    <input type="checkbox" class="checkbox lb-toggle" id="chk-highlight-<?php echo $index+1; ?>" data-name="highlight_flg"  value="1"
                                    <?php echo $tShop->getHighlightFlg()==1 ?"checked='checked'":''; ?> />
                                    <label for="chk-highlight-<?php echo $index+1; ?>"></label>
                                </p>
                                <p class="inline-table clearMgr">
                                    Hiển thị
                                    <input type="checkbox" class="checkbox lb-toggle" id="chk-delete-<?php echo $tShop->getId(); ?>" data-name="delete_flg" value="1"
                                    <?php echo ($tShop->shop_deleted_at)==NULL?"checked='checked'":''; ?> />
                                    <label for="chk-delete-<?php echo $tShop->getId(); ?>"></label>
                                </p>
                            </td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
    <div class="clearfix"></div>
</div>